#ifndef SEGMENTEDOBJECT_H
class Segmentation;
#define SEGMENTEDOBJECT_H

#include <QSet>
#include "Segmentation.h"


/**
  * This class represents a segmented object into a Segmented Image.
  */
class SegmentedObject
{

    // All the pixels which compose the segmented object
    QSet<int> * pixels;

    // The pixels which correspond to the fronti
    QSet<int> * frontier;

    // Segmentation container
    Segmentation * segmentationContainer;

public:

    /**
      * SegmentedObject constructor.
      *
      */
    SegmentedObject(Segmentation * s);

    /**
      * SegmentedObject destructor.
      *
      */
    ~SegmentedObject();

    /**
      * Add a pixel to the Segmented Object area.
      *
      * @param pixelNumber Number of the pixel to insert into the Segmented object.
      */
    void addPixel(int pixelNumber) { pixels->insert(pixelNumber); }
    /**
      * Add a pixel to the frontier.
      *
      * @param pixelNumber Number of the pixel to insert into the frontier.
      */
    void addPixelToFrontier(int pixelNumber) { frontier->insert(pixelNumber); }

    /**
      * Returns the Set of all the pixels included into the Segmented object.
      *
      * @return Set of all the pixels included into the Segmented area.
      */
    QSet<int> * getSegmentedObject();

    /**
      * Returns the Set of pixels included into the Segmented object.
      *
      * @return Set of all the pixels included into the Segmented area.
      */
    QSet<int> * getFrontier();

    Segmentation * getSegmentation() { return segmentationContainer; }

};
#endif // SEGMENTEDOBJECT_H
